-- 建表语句
CREATE TABLE [dbo].[t_user]
(
    [id]   int                                       NOT NULL,
    [name] varchar(255) COLLATE Chinese_PRC_CS_AI_WS NULL,
    CONSTRAINT [PK__user__3213E83F4C7BD7DB] PRIMARY KEY CLUSTERED ([id])
        WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
        ON [PRIMARY]
)
    ON [PRIMARY]
GO

ALTER TABLE [dbo].[t_user]
    SET (LOCK_ESCALATION = TABLE)
CREATE TABLE [dbo].[goods]
(
    [id]    bigint                                    NOT NULL,
    [name]  varchar(255) COLLATE Chinese_PRC_CS_AI_WS NULL,
    [code]  varchar(255) COLLATE Chinese_PRC_CS_AI_WS NULL,
    [price] money                                     NULL,
    CONSTRAINT [PK__goods__3213E83F17511C73] PRIMARY KEY CLUSTERED ([id])
        WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
        ON [PRIMARY]
)
    ON [PRIMARY]
GO

ALTER TABLE [dbo].[goods]
    SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
     'MS_Description', N'主键',
     'SCHEMA', N'dbo',
     'TABLE', N'goods',
     'COLUMN', N'id'
GO

EXEC sp_addextendedproperty
     'MS_Description', N'名称',
     'SCHEMA', N'dbo',
     'TABLE', N'goods',
     'COLUMN', N'name'
GO

EXEC sp_addextendedproperty
     'MS_Description', N'编码',
     'SCHEMA', N'dbo',
     'TABLE', N'goods',
     'COLUMN', N'code'
GO

EXEC sp_addextendedproperty
     'MS_Description', N'价格',
     'SCHEMA', N'dbo',
     'TABLE', N'goods',
     'COLUMN', N'price'


CREATE TABLE [dbo].[address]
(
    [id]      int                                       NOT NULL,
    [info]    varchar(255) COLLATE Chinese_PRC_CS_AI_WS NULL,
    [user_id] int                                       NULL,
    CONSTRAINT [PK__add__3213E83F7989DEE9] PRIMARY KEY CLUSTERED ([id])
        WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
        ON [PRIMARY]
)
    ON [PRIMARY]
GO

ALTER TABLE [dbo].[address]
    SET (LOCK_ESCALATION = TABLE)


-- 数据

INSERT INTO [dbo].[address] ([id], [info], [user_id])
VALUES (1, '山东', 1);
INSERT INTO [dbo].[address] ([id], [info], [user_id])
VALUES (2, '济南', 2);

INSERT INTO [dbo].[goods] ([id], [name], [code], [price])
VALUES (1, '鼠标', 's', 15.0000);

INSERT INTO [dbo].[t_user] ([id], [name])
VALUES (1, '小明');
INSERT INTO [dbo].[t_user] ([id], [name])
VALUES (2, '小红');
INSERT INTO [dbo].[t_user] ([id], [name])
VALUES (3, '小丽');
